package cn.doways.api.utils;


import java.util.Random;

/**
 * @ClassName RandomString
 * @Description //TODO
 * @Author shellming
 * @Date 2019-08-11 18:50
 **/
public class RandomString {
    public static String getRandomString(int length) {
        String str="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
        Random random=new Random();
        StringBuilder sb=new StringBuilder();
        for(int i=0;i<length;i++){
            int number=random.nextInt(62);
            sb.append(str.charAt(number));
        }
        return sb.toString();
    }
}
